package com.haiqiu.tools.test.config;

import com.haiqiu.file.oss.utils.OssUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author HaiQiu
 * @since 2023/3/2
 */

@ControllerAdvice
public class GlobalException {

    private static final Logger log = LoggerFactory.getLogger(GlobalException.class);

    @ExceptionHandler
    @ResponseBody
    public Object handle(Exception e){
        log.error(e.getMessage());
        e.printStackTrace();
        return e.getMessage();
    }
}
